<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:p="http://primefaces.org/ui">
    
    
        <div style="float: left;">
            <a href="index.xhtml"><img align="middle" src="resources/images/chums_main_logo.png" /></a>
            <span style="text-align: center; margin-left: 20px; font-size: large">CHUMS - MOOC Portal</span>

        </div>

        
        <center>
            <a style="margin-left: -300px;" href="allCourses.xhtml">All Courses</a>
            <a style="margin-left: 20px;" href="allInstitutions.xhtml">All Institutions</a>
            <a style="margin-left: 20px;" href="allInstructors.xhtml">All Instructors</a>
        </center>
    
    
        <!-- ************* LOGGED IN USER ************* -->
        <h:panelGroup rendered="#{loginBean.isUser}">  
            
            <div class="alignRight">
                <h:form>  
                    
                    <div style="margin-top:45px;">
                        <center>
                            
                            <a href="myCourses.xhtml">My Courses</a>
                            <a style="margin-left: 20px;" href="settings.xhtml">Settings</a>
                            <div class="alignRight">
                                <p:commandLink style="margin-left: 20px;align: center" value="Log out (#{loginBean.user.name})"  action="#{loginBean.logout}"/>
                            </div>

                        </center>
                    </div>
                </h:form>
            </div>  
        </h:panelGroup>

        
        <!-- ************* LOGGED IN ADMIN ************* -->
        <h:panelGroup rendered="#{loginBean.isAdmin}">  
            <div class="alignRight">
                <h:form>  
                    <div style="margin-top:45px;">
                        <center>
                            <a style="margin-left: 20px;"  href="manageSources.xhtml">Management</a>
                            <a style="margin-left: 20px;"  href="reports.xhtml">Reports</a>

                            <div class="alignRight">
                                <p:commandLink style="margin-left: 20px;align: center" value="Log out (#{loginBean.user.name})"  action="#{loginBean.logout}"/>
                            </div>
                        </center>
                    </div>
                </h:form>
            </div>  
        </h:panelGroup>

        
        
        <!-- ************* GUEST ************* -->
        <h:panelGroup rendered="#{!loginBean.loggedIn}">  
            <div class="alignRight">
                <h:form>  
                    <div style="margin-top:45px;">
                        <center>
                            <a href="register.xhtml">Sign up</a>
                            <a style="margin-left: 20px;" href="login.xhtml">Log in</a>
                        </center>
                    </div>
                </h:form>
            </div>
        </h:panelGroup>
        
</ui:composition>

